import { CHANGECOLLAPSED } from '../constant.js'

const initState = {collapsed: false}

export default function CollapsedReducer(preState=initState, action) {
	const {type} = action
	switch (type) {
		case CHANGECOLLAPSED:
			let newState = {...preState}
			newState.collapsed = !newState.collapsed
			return newState
		default: 
			return preState
	}
}